<?php

namespace app\admin\controller\data;

use app\admin\service\OrderStatisticsService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 * OrderStatistics 控制器
 * Class OrderStatistics
 * @package app\admin\controller\data;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 */
class OrderStatistics
{
    // 请求参数
    private Request $request;

    // service
    private OrderStatisticsService $service;

    public function __construct(Request $request, OrderStatisticsService $orderStatisticsService)
    {
        $this->request = $request;
        $this->service = $orderStatisticsService;
    }

    /**
     * 详情
     * @return ApiResponse
     * @url /data/order_statistics/read
     */
    public function read(): ApiResponse
    {
        $request = $this->request;

        return ApiResponse::success($this->service->readOfData($request->param()));
    }
}
